package com.itheima.web.job;

import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {

    @DubboReference
    private AnalysisByDayService analysisByDayService;

    // @Scheduled(cron = "0/30 * * * * ?")  // 间隔30秒触发
    @Scheduled(cron = "0 0 0/1 * * ?")  // 间隔1小时触发
    public void logToAnalysisByDay() {
        analysisByDayService.LogToAnalysisByDay();
        System.out.println("日志计算并保存到每日分表中....");
    }
}
